<template>
	<view class="container">
		<!-- 顶部导航栏 -->
		<view class="nav-header">
			<view class="nav-bar">
				<view class="nav-left" @click="goBack">
					<uni-icons type="left" size="24" color="#FFFFFF"></uni-icons>
				</view>
				<view class="nav-title">个人信息</view>
				<view class="nav-right">
					<uni-icons type="ellipsis" size="24" color="#FFFFFF"></uni-icons>
				</view>
			</view>

			<!-- 占位区域 -->
			<view class="search-placeholder"></view>
		</view>

		<!-- 内容区域 -->
		<view class="content-view">
			<scroll-view class="content-scroll" scroll-y>
				<!-- 个人信息卡片 -->
				<view class="info-card">
				<!-- 头像部分 -->
				<view class="avatar-item" @click="goToEdit">
					<text class="label">头像</text>
					<view class="avatar-container">
						<image class="avatar" src="../../../static/image/我的-我的@2x.png" mode="aspectFill"></image>
						<uni-icons type="right" size="16" color="#999999"></uni-icons>
					</view>
				</view>

				<!-- 姓名部分 -->
				<view class="info-item" @click="goToEdit">
					<text class="label">姓名</text>
					<view class="value-container">
						<text class="value">{{ userName }}</text>
						<uni-icons type="right" size="16" color="#999999"></uni-icons>
					</view>
				</view>

				<!-- 电话部分 -->
				<view class="info-item" @click="goToEdit">
					<text class="label">电话</text>
					<view class="value-container">
						<text class="value">{{ userPhone }}</text>
						<uni-icons type="right" size="16" color="#999999"></uni-icons>
					</view>
				</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	
	const userName = ref('张先生');
	const userPhone = ref('15023457896');
	
	// 返回上一页
	const goBack = () => {
		uni.navigateBack();
	};
	
	// 跳转到编辑页面
	const goToEdit = () => {
		uni.navigateTo({
			url: '/pages/my/personalInformation/editInformation/editInformation'
		});
	};
</script>

<style scoped>
	.container {
		width: 100%;
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #f5f5f5;
		overflow: hidden;
	}

	/* 顶部导航栏 */
	.nav-header {
		background: linear-gradient(180deg, #2477F4 0%, #166BEC 100%);
		padding-top: 30rpx;
		padding-bottom: 30rpx;
	}

	.nav-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 30rpx;
		padding-top: calc(20rpx + env(safe-area-inset-top));
		position: relative;
	}

	.nav-left {
		width: 80rpx;
		display: flex;
		align-items: center;
		cursor: pointer;
	}

	.nav-title {
		flex: 1;
		text-align: center;
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
		position: absolute;
		left: 0;
		right: 0;
		pointer-events: none;
	}

	.nav-right {
		width: 80rpx;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.ml-20 {
		margin-left: 20rpx;
	}

	/* 占位区域 */
	.search-placeholder {
		height: 250rpx;
	}

	/* 内容视图 */
	.content-view {
		flex: 1;
		padding: 0 30rpx 20rpx 30rpx;
		margin-top: -250rpx;
		height: 0;
		overflow: visible;
		display: flex;
		flex-direction: column;
	}

	.content-scroll {
		flex: 1;
		height: 0;
		width: 100%;
	}

	/* 信息卡片样式 */
	.info-card {
		background: #fff;
		border-radius: 20rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
		margin-bottom: 20rpx;
		padding: 20rpx;
		box-sizing: border-box;
	}
	
	/* 头像项样式 */
	.avatar-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30rpx;
		border-bottom: 1rpx solid #EEEEEE;
	}
	
	.avatar-container {
		display: flex;
		align-items: center;
	}
	
	.avatar {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
	}
	
	/* 普通信息项样式 */
	.info-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30rpx;
		border-bottom: 1rpx solid #EEEEEE;
	}
	
	.info-item:last-child {
		border-bottom: none;
	}
	
	.label {
		font-size: 32rpx;
		color: #333333;
	}
	
	.value-container {
		display: flex;
		align-items: center;
	}
	
	.value {
		font-size: 32rpx;
		color: #666666;
		margin-right: 10rpx;
	}
</style>
